import RequestUtils from '@/utils/RequestUtils'

export default {
	/**
	 * 新增
	 * @param params
	 * @returns {AxiosPromise}
	 */
	add(params = {}) {
		return RequestUtils({
			url: `/basic/customer`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
  prove(params = {}) {
    return RequestUtils({
      url: `/basic/customer/prove`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
	/**
	 * 批量删除（多个用逗号隔开）
	 * @param ids
	 * @returns {AxiosPromise}
	 */
	remove(ids) {
		return RequestUtils({
			url: `/basic/customer/${ids}`,
			method: 'DELETE'
		})
	},
  
  updateCompany(params = {}) {
  	return RequestUtils({
  		url: `/basic/customer/updateCompany`,
  		method: 'POST',
  		data: {
  			...params
  		}
  	})
  },
	/**
	 * 修改
	 * @param params
	 * @returns {AxiosPromise}
	 */
	edit(params = {}) {
		return RequestUtils({
			url: `/basic/customer`,
			method: 'PUT',
			data: {
				...params
			}
		})
	},
	/**
	 * 批量作废（多个用逗号隔开）
	 * @param ids
	 * @returns {AxiosPromise}
	 */
	logicalDelete(ids) {
		return RequestUtils({
			url: `/basic/customer/logicalDelete/${ids}`,
			method: 'POST'
		})
	},
	/**
	 * 详情
	 * @param id
	 * @returns {AxiosPromise}
	 */
	get(id) {
		return RequestUtils({
			url: `/basic/customer/${id}`,
			method: 'GET'
		})
	},
	/**
	 * 列表
	 * @param params
	 * @returns {AxiosPromise}
	 */
	//详情
	getMyCustInfor(params = {}) {
		return RequestUtils({
			url: `/basic/customer/getMyCustInfor`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
  getMyInfor(params = {}) {
  	return RequestUtils({
  		url: `/basic/customer/getMyInfor`,
  		method: 'POST',
  		data: {
  			...params
  		}
  	})
  },
  
  
	list(params = {}) {
		return RequestUtils({
			url: `/basic/customer/search`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	/**
	 * 列表-分页
	 * @param params
	 * @returns {AxiosPromise}
	 */
	page(params = {}, page) {
		return RequestUtils({
			url: `/basic/customer/search/${page.current}/${page.pageSize}`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	checkCode(params = {}) {
		return RequestUtils({
			url: `/basic/customer/checkCode`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	/**
	 * 企业注册
	 * @param params
	 * @returns {AxiosPromise}
	 */
	insertFactoryUser(params = {}) {
		return RequestUtils({
			url: `/basic/customer/insertFactoryUser`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	/**
	 * 银行或保理公司注册
	 * @param params
	 * @returns {AxiosPromise}
	 */
	insertBankUser(params = {}) {
		return RequestUtils({
			url: `/basic/customer/insertBankUser`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	/**
	 * 导出
	 * @param params
	 * @returns {AxiosPromise}
	 */
	exportData(params = {}) {
		return RequestUtils({
			url: `/basic/customer/exportData`,
			method: 'POST',
			data: {
				...params
			}
		})
	}
}
